<template>
  <div>
    <div>
      <h4>轻触觉</h4>
      <el-row type="flex" justify="space-between">
        <el-col :span="12">
          <div>
            <span>C2左 </span>
            <el-input v-model="pgForm.light_touch_input1" placeholder="" @blur="isNaNa(pgForm.light_touch_input1)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C2右 </span>
            <el-input v-model="pgForm.light_touch_input2" placeholder="" @blur="isNaNa(pgForm.light_touch_input2)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C3左 </span>
            <el-input v-model="pgForm.light_touch_input3" placeholder="" @blur="isNaNa(pgForm.light_touch_input3)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C3右 </span>
            <el-input v-model="pgForm.light_touch_input4" placeholder="" @blur="isNaNa(pgForm.light_touch_input4)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C4左 </span>
            <el-input v-model="pgForm.light_touch_input5" placeholder="" @blur="isNaNa(pgForm.light_touch_input5)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C4右 </span>
            <el-input v-model="pgForm.light_touch_input6" placeholder="" @blur="isNaNa(pgForm.light_touch_input6)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C5左 </span>
            <el-input v-model="pgForm.light_touch_input7" placeholder="" @blur="isNaNa(pgForm.light_touch_input7)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C5右 </span>
            <el-input v-model="pgForm.light_touch_input8" placeholder="" @blur="isNaNa(pgForm.light_touch_input8)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C6左 </span>
            <el-input v-model="pgForm.light_touch_input9" placeholder="" @blur="isNaNa(pgForm.light_touch_input9)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C6右 </span>
            <el-input v-model="pgForm.light_touch_input10" placeholder="" @blur="isNaNa(pgForm.light_touch_input10)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C7左 </span>
            <el-input v-model="pgForm.light_touch_input11" placeholder="" @blur="isNaNa(pgForm.light_touch_input11)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C7右 </span>
            <el-input v-model="pgForm.light_touch_input12" placeholder="" @blur="isNaNa(pgForm.light_touch_input12)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C8左 </span>
            <el-input v-model="pgForm.light_touch_input13" placeholder="" @blur="isNaNa(pgForm.light_touch_input13)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>C8右 </span>
            <el-input v-model="pgForm.light_touch_input14" placeholder="" @blur="isNaNa(pgForm.light_touch_input14)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T1左 </span>
            <el-input v-model="pgForm.light_touch_input15" placeholder="" @blur="isNaNa(pgForm.light_touch_input15)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T1右 </span>
            <el-input v-model="pgForm.light_touch_input16" placeholder="" @blur="isNaNa(pgForm.light_touch_input16)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T2左 </span>
            <el-input v-model="pgForm.light_touch_input17" placeholder="" @blur="isNaNa(pgForm.light_touch_input17)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T2右 </span>
            <el-input v-model="pgForm.light_touch_input18" placeholder="" @blur="isNaNa(pgForm.light_touch_input18)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T3左 </span>
            <el-input v-model="pgForm.light_touch_input19" placeholder="" @blur="isNaNa(pgForm.light_touch_input19)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T3右 </span>
            <el-input v-model="pgForm.light_touch_input20" placeholder="" @blur="isNaNa(pgForm.light_touch_input20)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T4左 </span>
            <el-input v-model="pgForm.light_touch_input21" placeholder="" @blur="isNaNa(pgForm.light_touch_input21)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T4右 </span>
            <el-input v-model="pgForm.light_touch_input22" placeholder="" @blur="isNaNa(pgForm.light_touch_input22)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T5左 </span>
            <el-input v-model="pgForm.light_touch_input23" placeholder="" @blur="isNaNa(pgForm.light_touch_input23)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T5右 </span>
            <el-input v-model="pgForm.light_touch_input24" placeholder="" @blur="isNaNa(pgForm.light_touch_input24)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T6左 </span>
            <el-input v-model="pgForm.light_touch_input25" placeholder="" @blur="isNaNa(pgForm.light_touch_input25)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T6右 </span>
            <el-input v-model="pgForm.light_touch_input26" placeholder="" @blur="isNaNa(pgForm.light_touch_input26)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T7左 </span>
            <el-input v-model="pgForm.light_touch_input27" placeholder="" @blur="isNaNa(pgForm.light_touch_input27)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T7右 </span>
            <el-input v-model="pgForm.light_touch_input28" placeholder="" @blur="isNaNa(pgForm.light_touch_input28)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T8左 </span>
            <el-input v-model="pgForm.light_touch_input29" placeholder="" @blur="isNaNa(pgForm.light_touch_input29)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T8右 </span>
            <el-input v-model="pgForm.light_touch_input30" placeholder="" @blur="isNaNa(pgForm.light_touch_input30)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T9左 </span>
            <el-input v-model="pgForm.light_touch_input31" placeholder="" @blur="isNaNa(pgForm.light_touch_input31)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T9右 </span>
            <el-input v-model="pgForm.light_touch_input32" placeholder="" @blur="isNaNa(pgForm.light_touch_input32)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T10左 </span>
            <el-input v-model="pgForm.light_touch_input33" placeholder="" @blur="isNaNa(pgForm.light_touch_input33)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T10右 </span>
            <el-input v-model="pgForm.light_touch_input34" placeholder="" @blur="isNaNa(pgForm.light_touch_input34)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T11左 </span>
            <el-input v-model="pgForm.light_touch_input35" placeholder="" @blur="isNaNa(pgForm.light_touch_input35)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T11右 </span>
            <el-input v-model="pgForm.light_touch_input36" placeholder="" @blur="isNaNa(pgForm.light_touch_input36)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T12左 </span>
            <el-input v-model="pgForm.light_touch_input37" placeholder="" @blur="isNaNa(pgForm.light_touch_input37)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>T12右 </span>
            <el-input v-model="pgForm.light_touch_input38" placeholder="" @blur="isNaNa(pgForm.light_touch_input38)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>L1左 </span>
            <el-input v-model="pgForm.light_touch_input39" placeholder="" @blur="isNaNa(pgForm.light_touch_input39)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>L1右 </span>
            <el-input v-model="pgForm.light_touch_input40" placeholder="" @blur="isNaNa(pgForm.light_touch_input40)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>L2左 </span>
            <el-input v-model="pgForm.light_touch_input41" placeholder="" @blur="isNaNa(pgForm.light_touch_input41)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>L2右 </span>
            <el-input v-model="pgForm.light_touch_input42" placeholder="" @blur="isNaNa(pgForm.light_touch_input42)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>L3左 </span>
            <el-input v-model="pgForm.light_touch_input43" placeholder="" @blur="isNaNa(pgForm.light_touch_input43)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>L3右 </span>
            <el-input v-model="pgForm.light_touch_input44" placeholder="" @blur="isNaNa(pgForm.light_touch_input44)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>L4左 </span>
            <el-input v-model="pgForm.light_touch_input45" placeholder="" @blur="isNaNa(pgForm.light_touch_input45)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>L4右 </span>
            <el-input v-model="pgForm.light_touch_input46" placeholder="" @blur="isNaNa(pgForm.light_touch_input46)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>L5左 </span>
            <el-input v-model="pgForm.light_touch_input47" placeholder="" @blur="isNaNa(pgForm.light_touch_input47)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>L5右 </span>
            <el-input v-model="pgForm.light_touch_input48" placeholder="" @blur="isNaNa(pgForm.light_touch_input48)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>S1左 </span>
            <el-input v-model="pgForm.light_touch_input49" placeholder="" @blur="isNaNa(pgForm.light_touch_input49)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>S1右 </span>
            <el-input v-model="pgForm.light_touch_input50" placeholder="" @blur="isNaNa(pgForm.light_touch_input50)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>S2左 </span>
            <el-input v-model="pgForm.light_touch_input51" placeholder="" @blur="isNaNa(pgForm.light_touch_input51)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>S2右 </span>
            <el-input v-model="pgForm.light_touch_input52" placeholder="" @blur="isNaNa(pgForm.light_touch_input52)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>S3左 </span>
            <el-input v-model="pgForm.light_touch_input53" placeholder="" @blur="isNaNa(pgForm.light_touch_input53)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>S3右 </span>
            <el-input v-model="pgForm.light_touch_input54" placeholder="" @blur="isNaNa(pgForm.light_touch_input54)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>S4-5左 </span>
            <el-input v-model="pgForm.light_touch_input55" placeholder="" @blur="isNaNa(pgForm.light_touch_input55)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            <span>S4-5右 </span>
            <el-input v-model="pgForm.light_touch_input56" placeholder="" @blur="isNaNa(pgForm.light_touch_input56)"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col>
          <div>
            <span>轻触觉总分（最大112分） </span>
            <el-input v-model="pgForm.light_touch_input57" placeholder="" readonly style="width: 10%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
export default {
  name: "light_touch",
  title: "轻触觉",
  created() {
    if(this.istrans){
      this.pgForm=this.fromdata
    }
  },
  props: {
    fromdata:{},
    istrans:false,
  },
  data() {
    return {
      pgForm: {
        light_touch_input1: '',
        light_touch_input2: '',
        light_touch_input3: '',
        light_touch_input4: '',
        light_touch_input5: '',
        light_touch_input6: '',
        light_touch_input7: '',
        light_touch_input8: '',
        light_touch_input9: '',
        light_touch_input10: '',
        light_touch_input11: '',
        light_touch_input12: '',
        light_touch_input13: '',
        light_touch_input14: '',
        light_touch_input15: '',
        light_touch_input16: '',
        light_touch_input17: '',
        light_touch_input18: '',
        light_touch_input19: '',
        light_touch_input20: '',
        light_touch_input21: '',
        light_touch_input22: '',
        light_touch_input23: '',
        light_touch_input24: '',
        light_touch_input25: '',
        light_touch_input26: '',
        light_touch_input27: '',
        light_touch_input28: '',
        light_touch_input29: '',
        light_touch_input30: '',
        light_touch_input31: '',
        light_touch_input32: '',
        light_touch_input33: '',
        light_touch_input34: '',
        light_touch_input35: '',
        light_touch_input36: '',
        light_touch_input37: '',
        light_touch_input38: '',
        light_touch_input39: '',
        light_touch_input40: '',
        light_touch_input41: '',
        light_touch_input42: '',
        light_touch_input43: '',
        light_touch_input44: '',
        light_touch_input45: '',
        light_touch_input46: '',
        light_touch_input47: '',
        light_touch_input48: '',
        light_touch_input49: '',
        light_touch_input50: '',
        light_touch_input51: '',
        light_touch_input52: '',
        light_touch_input53: '',
        light_touch_input54: '',
        light_touch_input55: '',
        light_touch_input56: '',
        light_touch_input57: '',
      }
    }
  },
  methods: {
    isNaNa(val){
      if(isNaN(val)){
        this.open()
        for(var i in this.pgForm){
          if(this.pgForm[i] === val){
            this.pgForm[i] = ''
          }
        }
      }
    },
    open() {
      this.$message({
        message: '请输入数字！',
        type: 'warning'
      });
    },
  },
  computed: {
    sum(){
      return (this.pgForm.light_touch_input1)*1+(this.pgForm.light_touch_input2)*1+(this.pgForm.light_touch_input3)*1+(this.pgForm.light_touch_input4)*1+(this.pgForm.light_touch_input5)*1+(this.pgForm.light_touch_input6)*1+(this.pgForm.light_touch_input7)*1+(this.pgForm.light_touch_input8)*1+(this.pgForm.light_touch_input9)*1+(this.pgForm.light_touch_input10)*1+
        (this.pgForm.light_touch_input11)*1+(this.pgForm.light_touch_input12)*1+(this.pgForm.light_touch_input13)*1+(this.pgForm.light_touch_input14)*1+(this.pgForm.light_touch_input15)*1+(this.pgForm.light_touch_input16)*1+(this.pgForm.light_touch_input17)*1+(this.pgForm.light_touch_input18)*1+(this.pgForm.light_touch_input19)*1+(this.pgForm.light_touch_input20)*1+
        (this.pgForm.light_touch_input21)*1+(this.pgForm.light_touch_input22)*1+(this.pgForm.light_touch_input23)*1+(this.pgForm.light_touch_input24)*1+(this.pgForm.light_touch_input25)*1+(this.pgForm.light_touch_input26)*1+(this.pgForm.light_touch_input27)*1+(this.pgForm.light_touch_input28)*1+(this.pgForm.light_touch_input29)*1+(this.pgForm.light_touch_input30)*1+
        (this.pgForm.light_touch_input31)*1+(this.pgForm.light_touch_input32)*1+(this.pgForm.light_touch_input33)*1+(this.pgForm.light_touch_input34)*1+(this.pgForm.light_touch_input35)*1+(this.pgForm.light_touch_input36)*1+(this.pgForm.light_touch_input37)*1+(this.pgForm.light_touch_input38)*1+(this.pgForm.light_touch_input39)*1+(this.pgForm.light_touch_input40)*1+
        (this.pgForm.light_touch_input41)*1+(this.pgForm.light_touch_input42)*1+(this.pgForm.light_touch_input43)*1+(this.pgForm.light_touch_input44)*1+(this.pgForm.light_touch_input45)*1+(this.pgForm.light_touch_input46)*1+(this.pgForm.light_touch_input47)*1+(this.pgForm.light_touch_input48)*1+(this.pgForm.light_touch_input49)*1+(this.pgForm.light_touch_input50)*1+
        (this.pgForm.light_touch_input51)*1+(this.pgForm.light_touch_input52)*1+(this.pgForm.light_touch_input53)*1+(this.pgForm.light_touch_input54)*1+(this.pgForm.light_touch_input55)*1+(this.pgForm.light_touch_input56)*1
    }
  },
  watch: {
    sum(val){
      if(!isNaN(val)){
        this.pgForm.light_touch_input57 = val
      }
    }
  }
}
</script>

<style scoped>
.el-row{
  margin: 10px 0;
  padding: 20px 20px;
  background-color: #f9f9f9;
  flex-wrap: wrap;
  flex-direction: row;
}
.el-col {
  margin:10px 0;
}
.el-input{
  width: 75%;
}
</style>
